package com.hua.nailcampus.auth;

import com.hua.nailcampus.acl.model.User;
import com.hua.nailcampus.acl.model.vo.UserLoginVo;

/**
 * @Author:chenjianhua
 * @Date:2023/11/22 10:00
 * @Version 17
 * ThreadLocal工具类
 */

public class AuthContextHolder {

    //用户ID
    private static ThreadLocal<Integer> userId = new ThreadLocal<>();

    //用户信息对象
    private static ThreadLocal<User> user = new ThreadLocal<>();


    //userId操作的方法

    public static void setUserId(Integer _userId) {
        userId.set(_userId);
    }

    public static Integer getUserId() {
        return userId.get();
    }

    public static void setUse(User user1){
        user.set(user1);
    }

    public static User getUse(){
        return user.get();
    }
}
